package com.web44.springboot.service.impl;

import com.web44.springboot.bean.Emp;
import com.web44.springboot.service.ITeacherService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
import org.springframework.stereotype.Service;

/**
 * @Title: TeacherService
 * @Description:
 * @Auther: py
 * @Version: 1.0
 * @create 2024/2/28 13:55
 */
@Service
// 当Emp 这个bena 没有生成 TeacherService 就会被sping管理 几位生成TeacherService bean
// @ConditionalOnMissingBean(Emp.class)
@ConditionalOnBean(Emp.class)
public class TeacherService implements ITeacherService {

    Logger logger = LoggerFactory.getLogger(StudentService.class);
    @Override
    public void addTeacher() {
        logger.info("增加老师 info..");
        logger.debug("增加老师 debugger...");
        logger.error("增加老师 error...");
        System.out.println("增加老师....");
    }
}
